Add support for versions 3.15 and 3.16, drop support for versions 3.8 and below#68
Merged
Add support for versions 3.15 and 3.16, drop support for versions 3.8 and below#68
Conversation
Reviewer's GuideThis PR overhauls version support by removing DRF 3.1–3.8 and adding DRF 3.15–3.16 across project configuration, CI workflows, dependencies, and tests. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Consider refactoring the tox env definitions to use factor notation or dynamic generation to avoid manual repetition for each DRF version.
- It might be worthwhile to expand your GitHub Actions matrix to run tests across multiple Python versions, not just 3.13, to catch compatibility issues earlier.
- Centralizing the supported DRF versions (e.g. reading from a single source or generating config entries) could reduce the risk of version list drift in config.py and build.ini.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider refactoring the tox env definitions to use factor notation or dynamic generation to avoid manual repetition for each DRF version.
- It might be worthwhile to expand your GitHub Actions matrix to run tests across multiple Python versions, not just 3.13, to catch compatibility issues earlier.
- Centralizing the supported DRF versions (e.g. reading from a single source or generating config entries) could reduce the risk of version list drift in config.py and build.ini.
## Individual Comments
### Comment 1
<location> `tests/test_renderers.py:16` </location>
<code_context>
KLASS_FILE_CONTENT = (
- '{"3.2": {"rest_framework.generics": ["RetrieveDestroyAPIView", "ListAPIView"]},'
+ '{"3.9": {"rest_framework.generics": ["RetrieveDestroyAPIView", "ListAPIView"]},'
'"%s": {"rest_framework.generics": ["RetrieveDestroyAPIView", "ListAPIView"]}}' % VERSION
)
</code_context>
<issue_to_address>
Test data updated to reference version 3.9, but no tests for new versions 3.15 and 3.16.
Please add or update tests to cover versions 3.15 and 3.16 to ensure proper support and early detection of any issues.
Suggested implementation:
```python
assert context['other_versions'] == ['3.9', '3.15', '3.16']
```
```python
assert context['name'] == ListAPIView.__name__
assert isinstance(context['ancestors'], (list, tuple))
assert isinstance(context['direct_ancestors'], (list, tuple))
def test_context_versions_315_316(self, get_template_mock):
self.renderer.render('foo')
context = get_template_mock.return_value.render.call_args_list[0][0][0]
# Ensure 3.15 and 3.16 are present in other_versions
assert '3.15' in context['other_versions']
assert '3.16' in context['other_versions']
```
</issue_to_address>
### Comment 2
<location> `tests/test_renderers.py:101` </location>
<code_context>
self.renderer.render('foo')
context = get_template_mock.return_value.render.call_args_list[0][0][0]
- assert context['other_versions'] == ['3.2']
+ assert context['other_versions'] == ['3.9']
assert context['name'] == ListAPIView.__name__
assert isinstance(context['ancestors'], (list, tuple))
</code_context>
<issue_to_address>
Assertion only checks for '3.9' in other_versions, missing coverage for all supported versions.
Parametrize the test or add assertions to verify that 'other_versions' contains all supported versions, not just '3.9'.
Suggested implementation:
```python
expected_versions = ['3.9', VERSION]
# Remove the current version from other_versions if present, as it's usually excluded
expected_other_versions = [v for v in expected_versions if v != VERSION]
assert sorted(context['other_versions']) == sorted(expected_other_versions)
```
If there are more supported versions, update `expected_versions` accordingly. If you want to parametrize the test for each version, consider using pytest's `@pytest.mark.parametrize` decorator and refactor the test to accept a version argument.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
fjsj
approved these changes
Sep 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Update supported Django REST Framework versions and refresh tooling configuration.
New Features:
Enhancements:
CI:
Tests: